package gstudio.data;

import java.io.File;
import java.util.HashMap;
import java.util.Map;

public class IData {
	String[] arr = new String[] { "id", "title", "content", "pids", "mp3",
			"cids" };

	Map<String, String> map = new HashMap<String, String>();

	public IData() {
		init();
	}

	public String getValueOf(String key) {
		if(key.equals("mp3")){
			return DataIO.getInstance().getGsRootPath()+File.separator+map.get(key);
		}
		return map.get(key);
	}

	private void init() {
		for (String key : arr) {
			map.put(key, "");
		}
	}

	public void setValueOf(String key, String value) {
		if(key.equals("mp3")){
			String root=DataIO.getInstance().getGsRootPath();
			value=value.replace(root+File.separator,"");
		}
		
		map.put(key, value);
	}
	
	public String[] getKeys(){
		return arr;
	}
}
